package com.nuliji.tools;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;

/**
 * Created by gaojie on 2017/11/7.
 */

public class PageMessage<T> implements Serializable {

    @ApiModelProperty(value = "记录列表", required = true)
    private List<T> data = null;

    @ApiModelProperty(value = "当前页数", required = true)
    private int page = 0;

    @ApiModelProperty(value = "每页记录数", required = true)
    private int size = 0;

    @ApiModelProperty(value = "记录总数", required = true)
    private long count = 0;

    public PageMessage(List<T> data, int page, int size, int count) {
        this.data = data;
        this.page = page;
        this.size = size;
        this.count = Long.valueOf(count);
    }
    public PageMessage(List<T> data, int page, int size, long count) {
        this.data = data;
        this.page = page;
        this.size = size;
        this.count = count;
    }

    public int getPage() {
        return page;
    }

    public void setPage(int page) {
        this.page = page;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
